package leecode

import "sort"

func trainingPlanLCR(actions []int) []int {
	sort.Ints(actions)
	prime := make([]int, 0)
	noPrime := make([]int, 0)
	for _, num := range actions {
		if num%2 == 0 {
			noPrime = append(noPrime, num)
		} else {
			prime = append(prime, num)
		}
	}
	i := 0
	for ; i < len(prime); i++ {
		actions[i] = prime[i]
	}
	index := 0
	for ; i < len(actions); i++ {
		actions[i] = noPrime[index]
		index++
	}
	return actions
}
